package com.dalston.util;

import com.dalston.util.json.PhoneNuberSerializer;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Data;

/**
 * @author jh.pei
 * @date 2021/4/2 15:48
 */
@Data
@JsonSerialize(using = PhoneNuberSerializer.class)
public class CommonResult<T> {
    private int code;
    private String msg;
    private T Data;

    public static CommonResult success(Object object) {
        CommonResult<Object> result = new CommonResult<>();
        result.setCode(200);
        result.setData(object);
        result.setMsg("success");
        return result;
    }
    public static CommonResult success() {
        CommonResult<Object> result = new CommonResult<>();
        result.setCode(200);
        result.setMsg("success");
        return result;
    }
}
